package com.hqyj.base.service.impl;

import com.hqyj.base.mapper.InfoUserMapper;
import com.hqyj.base.model.InfoUser;
import com.hqyj.base.service.InfoUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ProjectName: ERP-System
 * @Package: com.hqyj.base.service.impl
 * @ClassName: UserServiceImpl
 * @Author: LiYi
 * @Date: 2021-09-06 14:39
 */

@Service
public class InfoUserServiceImpl implements InfoUserService {
    /*注入InfoMapper数据接口*/
    @Autowired
    private InfoUserMapper infoUserMapper;

    /*查询所有的InfoUser信息*/
    @Override
    public List<InfoUser> queryAllByInfoUser() {
        return infoUserMapper.queryAllByInfoUser();
    }

    /*添加一条数据到InfoUSer*/
    @Override
    public int addInfoUser(InfoUser infoUser) {
        return infoUserMapper.insert(infoUser);
    }

    /*根据Id删除InfoUser中的记录*/
    @Override
    public int deleteInfoUserById(int id) {
        return infoUserMapper.deleteByPrimaryKey(id);
    }

    /*根据Id查询当前数据*/
    @Override
    public InfoUser queryInfoUserById(int urlId) {
        return infoUserMapper.queryInfoUserById(urlId);
    }

    /*根据Id查询当前数据后，页面重新修改的数据*/
    @Override
    public int updateInfoUserById(InfoUser infoUser) {
        return infoUserMapper.updateByPrimaryKeySelective(infoUser);
    }

    /*使用关键字对InfoUser表的所有字段进行模糊查询*/
    @Override
    public List<InfoUser> queryFuzzy(String keyword) {
        return infoUserMapper.queryFuzzy(keyword);
    }
}
